adversarial fine-tuning
LORE: Lagrangian-Optimized Robust Embeddings for Visual Encoders
Visual encoders have become fundamental components in modern computer vision pipelines. However, ensuring robustness against adversarial perturbations remains a critical challenge. Recent efforts have explored both supervised and unsupervised adversarial fine-tuning strategies. We identify two key limitations in these approaches: (i) they often suffer from instability, especially during the early stages of fine-tuning, resulting in suboptimal convergence and degraded performance on clean data, and (ii) they exhibit a suboptimal trade-off between robustness and clean data accuracy, hindering the simultaneous optimization of both objectives. To overcome these challenges, we propose Lagrangian-Optimized Robust Embeddings (LORE), a novel unsupervised adversarial fine-tuning framework.
LORE: Lagrangian-Optimized Robust Embeddings for Visual Encoders
Khodabandeh, Borna, Afzali, Amirabbas, Afsharrad, Amirhossein, Mousavi, Seyed Shahabeddin, Lall, Sanjay, Amini, Sajjad, Moosavi-Dezfooli, Seyed-Mohsen
Visual encoders have become fundamental components in modern computer vision pipelines. However, ensuring robustness against adversarial perturbations remains a critical challenge. Recent efforts have explored both supervised and unsupervised adversarial fine-tuning strategies. We identify two key limitations in these approaches: (i) they often suffer from instability, especially during the early stages of fine-tuning, resulting in suboptimal convergence and degraded performance on clean data, and (ii) they exhibit a suboptimal trade-off between robustness and clean data accuracy, hindering the simultaneous optimization of both objectives. To overcome these challenges, we propose Lagrangian-Optimized Robust Embeddings (LORE), a novel unsupervised adversarial fine-tuning framework. LORE utilizes constrained optimization, which offers a principled approach to balancing competing goals, such as improving robustness while preserving nominal performance. By enforcing embedding-space proximity constraints, LORE effectively maintains clean data performance throughout adversarial fine-tuning. Extensive experiments show that LORE significantly improves zero-shot adversarial robustness with minimal degradation in clean data accuracy. Furthermore, we demonstrate the effectiveness of the adversarially fine-tuned CLIP image encoder in out-of-distribution generalization and enhancing the interpretability of image embeddings.
Learning from the Undesirable: Robust Adaptation of Language Models without Forgetting
Nam, Yunhun, Kim, Jaehyung, Jeong, Jongheon
Language models (LMs) are often adapted through supervised fine-tuning (SFT) to specialize their capabilities for downstream tasks. However, in typical scenarios where the fine-tuning data is limited, e.g., compared to pre-training, SFT can lead LMs to overfit, causing them to rely on spurious patterns within the target task or to compromise other broadly useful capabilities as a side effect of narrow specialization. In this paper, we propose Learning-from-the-Undesirable (LfU), a simple yet effective regularization scheme for SFT to mitigate overfitting issues when fine-tuning LMs with limited data. Specifically, we aim to regularize the fine-tuning process to favor solutions that are resilient to "undesirable" model updates, e.g., gradient ascent steps that steer the model toward undesirable behaviors. To this end, we propose a novel form of consistency regularization that directly aligns internal representations of the model with those after an undesirable update. By leveraging representation-level data augmentation through undesirable updates, LfU effectively promotes generalization under limited data. Our experiments on diverse LM downstream tasks show that LfU serves as an effective prior that enhances adaptability while preserving pretrained knowledge. For example, our LM from LfU achieves a 16.8% average improvement on math tasks compared to vanilla SFT on the same dataset, where the latter even leads to degraded performance on those tasks. Furthermore, LfU exhibits improved robustness to prompt variations, e.g., yielding a 92.1% lower standard deviation in output performances compared to SFT, highlighting its versatile effects.
Lorica: A Synergistic Fine-Tuning Framework for Advancing Personalized Adversarial Robustness
Qi, Tianyu, Xue, Lei, Zhan, Yufeng, Ma, Xiaobo
Abstract--The growing use of large pre-trained models in edge computing has made model inference on mobile clients both feasible and popular . Y et these devices remain vulnerable to adversarial attacks, threatening model robustness and security. Federated adversarial training (F A T) offers a promising solution by enhancing robustness while preserving client privacy. However, F A T often yields a generalized global model that struggles with heterogeneous client data, leading to limited personalization and significant communication overhead. In this paper, we propose Lorica, a personalized synergistic adversarial training framework that delivers customized defense models through a two-phase process. In Phase 1, Lorica applies LoRA-F A for local adversarial fine-tuning, enabling personalized robustness while reducing communication by uploading only LoRA-F A parameters. In Phase 2, a forward-gating selection strategy improves benign accuracy, further refining the personalized model. This yields tailored defense models that effectively balance robustness and accuracy. Extensive experiments on benchmark datasets demonstrate that Lorica can achieve up to 68 improvements in communication efficiency compared to state-of-the-art algorithms, while achieving up to 29.9% and 52.2% enhancements in adversarial robustness and benign accuracy, respectively. Index T erms--Pre-trained models, personalized federated learning, adversarial training, fine-tuning. With the rapid advancement of large language models (LLM), large-scale pre-trained models have garnered widespread attention across various fields, including computer vision [1] and autonomous driving [2], etc. Fine-tuning pre-trained models for downstream tasks has gradually established itself as a novel learning paradigm [3]. Meanwhile, the increasing computational power of edge devices has facilitated the localized deployment of the pre-trained models, unlocking their potential for various applications on devices [4]. However, recent studies have revealed substantial security risks associated with deploying pre-trained models on edge devices. T. Qi, and L. Xue are with the School of Cyber Science and Technology, Sun Y at-sen University, Shenzhen, China. Zhan is with the School of Automation, Beijing Institute of Technology, Beijing, China. X. Ma is with the School of Cyber Science and Engineering, Xi'an Jiaotong University, Xi'an, China. We also thank the Guangdong Key Laboratory of Information Security Technology for their support.
Detecting Adversarial Fine-tuning with Auditing Agents
Egler, Sarah, Schulman, John, Carlini, Nicholas
Large Language Model (LLM) providers expose fine-tuning APIs that let end users fine-tune their frontier LLMs. Unfortunately, it has been shown that an adversary with fine-tuning access to an LLM can bypass safeguards. Particularly concerning, such attacks may avoid detection with datasets that are only implicitly harmful. Our work studies robust detection mechanisms for adversarial use of fine-tuning APIs. We introduce the concept of a fine-tuning auditing agent and show it can detect harmful fine-tuning prior to model deployment. We provide our auditing agent with access to the fine-tuning dataset, as well as the fine-tuned and pre-fine-tuned models, and request the agent assigns a risk score for the fine-tuning job. We evaluate our detection approach on a diverse set of eight strong fine-tuning attacks from the literature, along with five benign fine-tuned models, totaling over 1400 independent audits. These attacks are undetectable with basic content moderation on the dataset, highlighting the challenge of the task. With the best set of affordances, our auditing agent achieves a 56.2% detection rate of adversarial fine-tuning at a 1% false positive rate. Most promising, the auditor is able to detect covert cipher attacks that evade safety evaluations and content moderation of the dataset. While benign fine-tuning with unintentional subtle safety degradation remains a challenge, we establish a baseline configuration for further work in this area. We release our auditing agent at https://github.com/safety-research/finetuning-auditor.
we changed the objective function so that a specified level of fairness is guaranteed; (2) we performed experiments
We thank all of the reviewers for their helpful reviews. Adversarial Learning", and we show that it does not outperform our methods. Please see the details below. We agree that our original objective function has no guarantee that the outcome is fair. See the table below (row 1). See the table below (row 2). See the table (row 3) and the figure below. As suggested, we compared our approaches to Zhang et al. "Mitigating Unwanted Biases with Adversarial Finally, we will improve the visibility of Figure 1 in our paper.
Early Approaches to Adversarial Fine-Tuning for Prompt Injection Defense: A 2022 Study of GPT-3 and Contemporary Models
Sandoval, Gustavo, Fenchenko, Denys, Chen, Junyao
This paper documents early research conducted in 2022 on defending against prompt injection attacks in large language models, providing historical context for the evolution of this critical security domain. This research focuses on two adversarial attacks against Large Language Models (LLMs): prompt injection and goal hijacking. We examine how to construct these attacks, test them on various LLMs, and compare their effectiveness. We propose and evaluate a novel defense technique called Adversarial Fine-Tuning. Our results show that, without this defense, the attacks succeeded 31\% of the time on GPT-3 series models. When using our Adversarial Fine-Tuning approach, attack success rates were reduced to near zero for smaller GPT-3 variants (Ada, Babbage, Curie), though we note that subsequent research has revealed limitations of fine-tuning-based defenses. We also find that more flexible models exhibit greater vulnerability to these attacks. Consequently, large models such as GPT-3 Davinci are more vulnerable than smaller models like GPT-2. While the specific models tested are now superseded, the core methodology and empirical findings contributed to the foundation of modern prompt injection defense research, including instruction hierarchy systems and constitutional AI approaches.